var app=angular.module("app",[]);
app.controller("controller1", ['$scope','$http','$location', function($scope,$http,$location){
	var a=$location.absUrl();
	console.log(a);
	//当地址栏的地址变化时在浏览器地址栏里面会有历史记录===/service/location.html#/aaa/bbb/ccc
	$location.path('aaa/bbb/ccc');
	//当地址栏的地址变化时在浏览器地址栏里面不会有历史记录
	//$location.path('aaa/bbb/ccc').replace();
	var pathValue=$location.path();///service/location.html#/aaa/bbb/ccc
	$location.hash('hello');
	var hashValue=$location.path();///service/location.html#/aaa/bbb/ccc#hello
	$location.search({'name':'20'});
	var searchValue=$location.path();///service/location.html#/aaa/bbb/ccc?name=20#hello
	console.log($location.search());//Object {name: "20"}
	console.log($location.protocol());//http
	// $location.path('');
	// $location.hash('');
	// $location.search('');
	
}]);

app.controller('controller2', ['$scope','$location','$anchorScroll', function($scope,$location,$anchorScroll){
	$scope.change = function(id){
		$location.hash(id);
		$anchorScroll();
	}
}]);